<template>
  <div class="qushuikou-popup">
    <div class="popup-header">
      <h3>{{ featureData.name || '地图要素' }}</h3>
      <span class="close-btn" @click="closePopup">×</span>
    </div>
    <div class="popup-body">
      <el-tabs v-model="activeName">
        <el-tab-pane label="基本信息" name="first">

          <div class="pollution-info">
            <div class="info-item">
              <label>取水口编码:</label>
              <span>{{ featureData.segmentdrinkcode || '未知' }}</span>
            </div>

            <div class="info-item">
              <label>取水口类型:</label>
              <span>{{ featureData.segmentcategory && this.segmentcategoryMap ?
                (this.segmentcategoryMap[featureData.segmentcategory] || '未知') : '未知' }}</span>
            </div>
            <div class="info-item">
              <label>水源地名称:</label>
              <span>{{ featureData.drinksourcename || '未知' }}</span>
            </div>
            <div class="info-item">
              <label>水源地简介:</label>
              <span>{{ featureData.introduction || '未知' }}</span>
            </div>
            <div class="info-item">
              <label>一级保护区描述:</label>
              <span>{{ featureData.primarydescribe || '未知' }}</span>
            </div>
            <div class="info-item">
              <label>一级保护区面积:</label>
              <span>{{ featureData.firstprotectarea || '未知' }} km²</span>
            </div>

            <div class="info-item">
              <label>二级保护区描述:</label>
              <span>{{ featureData.secondarydescribe || '未知' }}</span>
            </div>
            <div class="info-item">
              <label>二级保护区面积:</label>
              <span>{{ featureData.secondarydescribe || '未知' }} km²</span>
            </div>
            <div class="info-item">
              <label>准保护区描述:</label>
              <span>{{ featureData.quasidescribe || '未知' }}</span>
            </div>
            <div class="info-item">
              <label>准保护区面积:</label>
              <span>{{ featureData.quasiprotectarea || '未知' }} km²</span>
            </div>


          </div>
        </el-tab-pane>
        <el-tab-pane label="视频" name="second">
          <video class="black-video-placeholder" controls="false"></video>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>


export default {
  name: 'qushuikouPopup',
  data() {
    return {
      activeName: "first",
      segmentcategoryMap: {
        '1': '河流',
        '2': '湖库',
        '3': '地下水'
      }
    };
  },


  props: {
    featureData: {
      type: Object,
      default: () => ({})
    },
    featureId: {
      type: String,
      default: ''
    }

  },
  computed: {

  },
  mounted() {
    //console.log(this.featureData);
  },
  methods: {
    closePopup() {
      this.$emit('close');
    },
  }
};
</script>

<style scoped>
.qushuikou-popup {
  min-width: 300px;
  /* max-width: 400px; */
}

.popup-header {
  padding: 12px 16px;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h3 {
  margin: 0;
  font-size: 16px;
  color: #303133;
}

.close-btn {
  cursor: pointer;
  font-size: 20px;
  color: #909399;
}

.close-btn:hover {
  color: #409eff;
}

.popup-body {
  padding: 16px;
}

.info-item {
  display: flex;
  margin-bottom: 10px;
  font-size: 14px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item label {
  width: 120px;
  color: #606266;
  font-weight: 500;
}

.info-item span {
  flex: 1;
  color: #303133;
}

.pollution-level {
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.level-一级 {
  background-color: #00c800;
}

.level-二级 {
  background-color: #ffff00;
  color: #333;
}

.level-三级 {
  background-color: #ffa500;
}

.level-四级 {
  background-color: #ff0000;
}

.level-未知 {
  background-color: #808080;
}
</style>